using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace Cpsc481Phone.Gui.Call
{
    public partial class CallBoxItem : UserControl
    {
        public CallBoxItem()
        {
            InitializeComponent();
        }
        // 1- missedcall 2- answered call 3- outgoing call
        // This method initializes the type of call box it is
        public void initCallBoxItem(int type, String name, String time)
        {
            switch (type)
            {
                case 1:
                    pictureBox1.BackgroundImage= global::Cpsc481Phone.Properties.Resources.MissedCall;
                    break;
                case 2:
                    pictureBox1.BackgroundImage = global::Cpsc481Phone.Properties.Resources.Answered;
                    break;
                case 3:
                    pictureBox1.BackgroundImage = global::Cpsc481Phone.Properties.Resources.OutgoingCall;
                    break;
            }
            smallName.Text = name;
            LargeName.Text = name;
            smallNameDate.Text = time;
            deSelect();
        }
        public void select()
        {
            LargeName.Visible = false;
            smallNameDate.Visible = true;
            smallName.Visible = true;
            this.BackColor = Color.Coral;
        }
        public void deSelect()
        {
            LargeName.Visible = true;
            smallNameDate.Visible = false;
            smallName.Visible = false;
            this.BackColor = Color.White;
        }
        

    }
}
